1 // Fig. 11.16: fig11_16.cpp 2 // Using hex, oct, dec and setbase stream manipulators. 3 #include 4 #include 5 6 int main() 7 { 8 int n; 9 10 cout << "Enter a decimal number: "; 11 cin >> n; 12 13 cout << n << " in hexadecimal is: " 14 << hex << n << '\n' 15 << dec << n << " in octal is: " 16 << oct << n << '\n' 17 << setbase( 10 ) << n << " in decimal is: " 18 << n << endl; 19 20 return 0; 21 }